package com.zytech.zspider.task;

import com.zytech.zspider.core.TaskDefinition;
import com.zytech.zspider.core.TaskResult;

/**
 * @author siuming
 */
public interface TaskExecutor {

    /**
     *
     */
    public enum Status {
        OPEN, SHUTDOWNING, SHUTDOWN
    }

    /**
     * @param task
     * @return
     */
    boolean isTaskSupports(TaskDefinition task);

    /**
     * @param task
     * @return
     */
    TaskResult submitTask(TaskDefinition task);

    /**
     * @param task
     * @param context
     * @return
     */
    TaskResult retryTask(TaskDefinition task, TaskContext context);


    /**
     * @return
     */
    TaskExpressionEvaluator getExpressionEvaluator();

    void shutdown();
}
